<? session_start();
if($_SERVER['REQUEST_URI'] == "//") {
header("Location: /");
exit; } elseif($_SERVER['REQUEST_URI'] == "/index.php") {
header("Location: /");
exit; } if (!file_exists('config.php')) {
header ("location: install/"); }
include('functions.php');
if(isset($_GET['op'])) { $op = $_GET['op']; }
if(isset($op) && $op == '1') {
$htm = <<<LIC
<html>
<head>
<title>oPanel V$ver</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet"href="style.css">
<link rel="shortcut icon" href="favicon.ico" />
</head>
<body onLoad="document.forms.login.username.focus()">
<center>
<form name="login" action='admin.php' method='post'>
<input type="hidden" name="op" value="1" />
<table height='80%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td>
<table border='0' background='images/login.png' width='277' height='192'>
	<tr><td>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%' id='AutoNumber1' valign='middle'>
  <tr>
    <td align='right'><b>Admin Username:</b></td>
    <td><input type='text' name='username' size='20'></td>
  </tr>
  <tr>
    <td align='right'><b>Admin Password:</b></td>
    <td><input type='password' name='password' size='20'><tr><td>
</div></td>
  </tr>
  <tr>
    <td colspan="2" align='center'><b> License Code:</b></td>
    </tr>
</table>
<center><input name='lice_1' type='text' size="4" maxlength="4">
- <input name='lice_2' type='text' size="7" maxlength="7">
- <input name='lice_3' type='text' size="7" maxlength="7">
- <input name='lice_4' type='text' size="4" maxlength="4"></center><br />
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%' id='AutoNumber2'>
  <tr>
    <td width='93%'>
    <p align='right'><input type='submit' name='submit' value='Login'></td>
    <td width='7%'>&nbsp;</td>
  </tr>
</table>
</table>
</div>
</td></tr></table></form></center>
<div style="position: absolute; width: 264px; height: 17px; z-index: 1; bottom: 0px; left:10px" id="credits">
oPanel V$ver by <a href="http://olliespage.net" target="_blank">OlliesPage.net</a></div>
<div style="position: absolute; width: 500px; height: 17px; z-index: 1; bottom: 0px; right: 19px; text-align: right" id="BetaTesters">
BETA testers: $BETAtesters</div>
</body>
</html>
LIC;
die($htm); }
/*****[BEGIN]******************************************
 [ Base:     oPanel Login                        v2.0.0 ]
 ******************************************************/
if(isset($_GET['redirect']) && $_GET['redirect'] == 'admin') { 
$hidden = "<input type='hidden' name='redirect' value='admin'>"; }
if(!isset($hidden)) { $hidden = ""; }
$disabled = "";
$msg = "Please Login";
if(!isset($error)) { $error = ""; }
$html_login = <<<EXO
<html>
<head>
<title>oPanel V$ver</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet"href="style.css">
<link rel="shortcut icon" href="favicon.ico" />
</head>
<body onLoad="document.forms.login.username.focus()">
<center>
<form name="login" action='login.php' method='post'>
$hidden
<table height='80%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td>
<table border='0' background='images/login.png' width='277' height='192'>
	<tr><td>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%' id='AutoNumber1' valign='middle'>
  <tr>
    <td align='right'><b> Username:</b></td>
    <td><input type='text' name='username' size='20'$disabled></td>
  </tr>
  <tr>
    <td align='right'><b> Password:</b></td>
    <td><input type='password' name='password' size='20'$disabled><tr><td>
</div></td>
  </tr>
</table>
<center>$msg</center>&nbsp;</br>
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%' id='AutoNumber2'>
  <tr>
    <td width='93%'>
    <p align='right'><input type='submit' name='submit' value='Login'$disabled></td>
    <td width='7%'>&nbsp;</td>
  </tr>
</table>
</table>
</div>
$error
</td></tr></table></form></center>
<div style="position: absolute; width: 264px; height: 17px; z-index: 1; bottom: 0px; left:10px" id="credits">
oPanel V$ver by <a href="http://olliespage.net" target="_blank">OlliesPage.net</a></div>
<div style="position: absolute; width: 500px; height: 17px; z-index: 1; bottom: 0px; right: 19px; text-align: right" id="BetaTesters">
BETA testers: $BETAtesters</div>
</body>
</html>
EXO;
if(!isset($_SESSION["user"]) || !isset($_SESSION["pass"]) || !isset($_SESSION["home"])) {
die($html_login);
}
if(isset($_SESSION["user"]) && ($_SESSION["user"] == "") && isset($_SESSION["pass"]) && ($_SESSION["pass"] == "")) {
die($html_login);
} elseif ($_SESSION["pass"] != check($_SESSION["user"])) {
die($html_login);
}
/*****[END]********************************************
 [ Base:     oPanel Login                        v2.0.0 ]
 ******************************************************/
?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>oPanel V<? echo $ver; ?></title>
<script language="Javascript" type="text/javascript">
if (document.all || document.layers) {
        self.moveTo(0,0);
        self.resizeTo(screen.availWidth,screen.availHeight);
}                                                           
</script>
<link rel="shortcut icon" href="favicon.ico" />
</head>
<frameset cols="*,300" border="0" frameborder="0"> 
  <frame src="list.php" border="0" frameborder="0" name="filemain" />
  <frameset rows="290,*" border="0" frameborder="0"> 
    <frame src="dirstuff.php" border="0" frameborder="0" name="infofr" />
    <frame src="trash.php" name="trashframe" border="0" frameborder="0" />
  </frameset>
</frameset><noframes></noframes>
</html>
